package com.example.mapper;

import com.example.entity.Comment;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CommentMapper {
    List<Comment> selectAll(Comment comment);

    void insert(Comment comment);

    void updateById(Comment comment);

    void deleteById(Integer id);
    @Select("SELECT COUNT(*) FROM comment WHERE id = #{id}")
    int setTotal(Integer id);
    @Select("SELECT SUM(score) FROM comment WHERE id = #{id}")
    double setSum(Integer id);
}
